var e = require;
var t = module;
var o = exports;
Object.defineProperty(o, "__esModule", {value: !0});
var n = e("BaseModuleUI"),
    a = e("GlobalParams"),
    i = e("AssetsManager"),
    r = e("RoleSoldierInfo"),
    s = e("UIManager"),
    l = cc._decorator,
    c = l.ccclass,
    d = l.property,
    h = (function (e) {
        function t() {
            var t = (null !== e && e.apply(this, arguments)) || this;
            return (
                (t.my_info_bg = null),
                (t.name_label = null),
                (t.head_sprite = null),
                (t.kill_info_label = null),
                (t.equip_node = null),
                (t.grade_sprite = null),
                (t.coin_num_label = null),
                (t.equip_view_node = null),
                (t.level_num = null),
                t
            );
        }
        return (
            __extends(t, e),
            (t.prototype.showPlayerInfo = function (e) {
                var t = a.GlobalParams.MatchGamePlayer[e];
                (this.my_info_bg.active = e == a.GlobalParams.MatchMyIndex),
                    (this.name_label.string = t.name),
                    (this.name_label.node.color =
                        e == a.GlobalParams.MatchMyIndex ? cc.color(20, 255, 50) : cc.color(255, 233, 77)),
                    (this.head_sprite.spriteFrame = i.default
                        .getInstance()
                        .getHeroHeadFrame(r.default.Role_info[t.role_id].C_ID)),
                    this.coin_num_label && (this.coin_num_label.string = "" + t.coin),
                    this.grade_sprite.node.active
                        ? (this.kill_info_label.string =
                              t.kill_info[0] + " / " + t.kill_info[1] + " / " + t.kill_info[2])
                        : (this.kill_info_label.string =
                              t.kill_info[0] + "    /     " + t.kill_info[1] + "    /     " + t.kill_info[2]);
                var o = 2 * t.kill_info[0] - t.kill_info[1] + 0.5 * t.kill_info[2];
                (this.grade_sprite.spriteFrame = i.default
                    .getInstance()
                    .getGradeTypeFrame("grade_" + this.getGradeType(o))),
                    this.my_info_bg.active &&
                        5 == this.getGradeType(o) &&
                        cc.find("UIManager").getComponent(s.default).playerTaskOverInfo(9, 1);
                for (var n = 0; n < this.equip_view_node.childrenCount; n++)
                    this.equip_view_node.children[n].children[0].getComponent(cc.Sprite).spriteFrame =
                        0 == t.equip_info[n]
                            ? null
                            : i.default.getInstance().getEquipIconFrame("equip_" + t.equip_info[n]);
                this.level_num.string = "" + t.level;
            }),
            (t.prototype.getGradeType = function (e) {
                return e < 0 ? 1 : e < 5 ? 2 : e < 10 ? 3 : e < 15 ? 4 : 5;
            }),
            __decorate([d(cc.Node)], t.prototype, "my_info_bg", void 0),
            __decorate([d(cc.Label)], t.prototype, "name_label", void 0),
            __decorate([d(cc.Sprite)], t.prototype, "head_sprite", void 0),
            __decorate([d(cc.Label)], t.prototype, "kill_info_label", void 0),
            __decorate([d(cc.Node)], t.prototype, "equip_node", void 0),
            __decorate([d(cc.Sprite)], t.prototype, "grade_sprite", void 0),
            __decorate([d(cc.Label)], t.prototype, "coin_num_label", void 0),
            __decorate([d(cc.Node)], t.prototype, "equip_view_node", void 0),
            __decorate([d(cc.Label)], t.prototype, "level_num", void 0),
            __decorate([c], t)
        );
    })(n.default);
o.default = h;
